package com.bu.model;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Text;

/**
 * @author xueqiang.mi
 * @since 2011-2-21
 */
@PersistenceCapable(table = "Problems", identityType = IdentityType.APPLICATION)
public class Problem {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent
	private String courses;
	@Persistent
	private String topics;
	@Persistent
	private Text problem;
	@Persistent
	private Text solution;
	@Persistent
	private String source;
	@Persistent
	private float difficulty;
	@Persistent
	private Text note;
	@Persistent
	private Date crtDate;
	@Persistent
	private boolean indexed = false;
	@NotPersistent
	private String problemHTML;

	public String getCourses() {
		return courses;
	}

	public Date getCrtDate() {
		return crtDate;
	}

	public float getDifficulty() {
		return difficulty;
	}

	public Long getId() {
		return id;
	}

	public Text getNote() {
		return note;
	}

	public Text getProblem() {
		return problem;
	}

	public String getProblemHTML() {
		return problemHTML;
	}

	public Text getSolution() {
		return solution;
	}

	public String getSource() {
		return source;
	}

	public String getTopics() {
		return topics;
	}

	public boolean isIndexed() {
		return indexed;
	}

	public void setCourses(String courses) {
		this.courses = courses;
	}

	public void setCrtDate(Date crtDate) {
		this.crtDate = crtDate;
	}

	public void setDifficulty(float difficulty) {
		this.difficulty = difficulty;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setIndexed(boolean indexed) {
		this.indexed = indexed;
	}

	public void setNote(Text note) {
		this.note = note;
	}

	public void setProblem(Text problem) {
		this.problem = problem;
	}

	public void setProblemHTML(String problemHTML) {
		this.problemHTML = problemHTML;
	}

	public void setSolution(Text solution) {
		this.solution = solution;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public void setTopics(String topics) {
		this.topics = topics;
	}

	@Override
	public String toString() {
		return "Problem [id=" + id + ", topics=" + topics + ", problem=" + problem + ", source=" + source + ", difficulty="
				+ difficulty + "]";
	}
}
